const seq = require("sequelize");
const time = require("../time");
module.exports = {
  NAME: "sys_logininfor",
  TABLE: {
    info_id: {
      type: seq.INTEGER(19),
      primaryKey: true,
      unique: true,
      autoIncrement: true,
      allowNull: false,
      comment: "info_id 主键，自增",
      field: "info_id", //  相应的字段名称
    },
    login_name: {
      type: seq.STRING(50),
      allowNull: false,
      comment: "登录账号",
      field: "login_name", //  相应的字段名称
      defaultValue: "",
    },
    ipaddr: {
      type: seq.STRING(128),
      comment: "登录IP地址",
      field: "ipaddr",
      defaultValue: "",
    },
    login_location: {
      type: seq.STRING(255),
      comment: "登录地点",
      field: "login_location",
      defaultValue: "",
    },
    browser: {
      type: seq.STRING(50),
      comment: "浏览器类型",
      field: "browser",
      defaultValue: "",
    },
    os: {
      type: seq.STRING(50),
      comment: "操作系统",
      field: "os",
      defaultValue: "",
    },
    status: {
      type: seq.CHAR(1),
      comment: "访问状态（1正常 0失败）",
      field: "status",
      defaultValue: "1",
    },
    msg: {
      type: seq.STRING(255),
      comment: "提示消息",
      field: "msg",
      defaultValue: "",
    },
    login_time: {
      // 创建时间戳
      type: seq.DATE(),
      comment: "访问时间",
      field: "login_time",
      defaultValue: () => {
        return Date.now();
      } /* 时间戳 */,
    },
    del_flag:{
      type: seq.CHAR(1),
      comment: '删除标志（0代表存在 2代表删除）',
      field: 'del_flag',
      defaultValue: '0'
    },
    del_by: {
      // 创建时间戳
      type: seq.INTEGER(11),
      comment: '删除人',
      field: 'del_by',
    }
  },
};
